package com.demo.dao_admin;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.demo.entity.ExamDTO;
import com.demo.entity.ExamDTO2;
import com.demo.entity.ExamExams;
import com.demo.entity.UserInformation;

@Repository("adminUserInformationDAO")
public interface UserinformationDAO extends JpaRepository<UserInformation, Long>, JpaSpecificationExecutor<UserInformation> {

	//解决关联查询的N+1问题
	@EntityGraph(value = "User.examUsers", type = EntityGraph.EntityGraphType.FETCH)
	Optional<UserInformation> findById(Long id);
	
	
}